{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->
		{include admin.inc.menu}
		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">
					<li><a href="{url /admin/singlepage/add}"><i class="glyphicon glyphicon-plus"></i> 添加单页</a></li>
					<li><a href="{url /admin/singlepage/index}"><i class="glyphicon glyphicon-th-list"></i>单页列表</a></li>
					<li><a href="{$index_url}" ><i class="glyphicon glyphicon-th-list"></i> 单页类型列表</a></li>
					<li {if $id==''}class="active"{/if}><a {if $id==''}href="javascript:void(0);"{else}href="{$add_url}"{/if}><i class="glyphicon glyphicon-plus"></i> 添加单页类型</a></li>
					{if $id != ''}<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-edit"></i> 编辑单页类型</a></li>{/if}

				</ul>
				<div class="inner-container">
					<form role="form" class="content-add-form form-horizontal" id="content-add-form" autocomplete="off">
						<!-- input -->
						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span>排序</label>
							<div class="col-sm-4">
							<input  dtype="" class="form-control" maxlength="5" name="data[sort_index]" placeholder="50" required cname="排序" value="{$item[sort_index]}" />
							<p class="help-block"></p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span>分类名称</label>
							<div class="col-sm-4">
								<input  dtype="" class="form-control" maxlength="20" name="data[name]" placeholder="" required cname="" value="{$item[name]}" />
								<p class="help-block"></p>
							</div>
							<div class="col-sm-3" style="color: grey;">
								(20字符以内)
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"><span class="asterisk">*</span>所属上级</label>
							<div class="col-sm-4">
								<select class="form-control select2" name="data[parent_id]">
									<option value="0">无</option>
									{loop $parents $p}
									{if $p['id']!=$item['id']}
									<option {if $item['parent_id']==$p['id']}selected{/if} value="{$p.id}">{$p.name}</option>
									{/if}
									{/loop}
								</select>
							</div>
						</div>

						<!-- textarea -->
						<div class="form-group">
							<label class="col-sm-2 control-label">分类描述</label>
							<div class="col-sm-6 control-label">
								<textarea class="form-control" maxlength="255" name="data[summary]" placeholder="分类描述" required cname="分类描述">{$item[summary]}</textarea>
								<p class="help-block" style="text-align: left"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-2" style="color: grey;">分类描述字符长度为255以内</div>
						</div>


						<p class="help-block"></p>
						<div class="form-group">
							<label class="col-sm-2 control-label">操作人</label>
							<div class="col-sm-2" style="padding-top: 4px">{$admin_name}</div>
						</div>
						<p class="help-block"></p>

						<!--tmpl-assocfields-->
						<div class="btn-group btn-group-or">
							<a href="{if $id==''}{$do_add_url}{else}{$do_edit_url}?id={$id}{/if}" class="btn btn-primary ajaxproxy"
								proxy='{"method":"post", "location":"{$index_url}"}'>提交保存</a>

						</div>
					</form><!-- content add form -->
				</div>
			</div><!-- end of inner -->
		</section>
	</div>
</div>
{include admin.inc.footer}

<!--tmpl-script-->

<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/information_singlepage_cateadd",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->
		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>


<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li> 
		{[loop pages page]}

		<li ><a class="assoc-page" data-page="{[page]}" {[if curr == page]}class="active"{[/if]} href="javascript:void(0)">{[page]}</a></li> 

		{[/loop]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li> 
	</ul>	
</div>
</script>

</body>
</html>
